<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="m" tagdir="/WEB-INF/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<link href="../css/style-admin-register-user.css" rel="stylesheet" type="text/css" />
	<link href="../css/style-admin-all.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<jsp:include page="header.jsp" />
	<div class="barra1">
		<jsp:include page="top-bar.jsp" />
	</div>
	<div class="header">
		<div class="height-1-ru">
			<c:if test="${user.id == null}">
				<form method="POST" action="#" id="form">
			</c:if>
			<c:if test="${user.id != null}">
				<form method="POST" action="../admin/edit-user.ja?cod=${user.id}" id="form">
			</c:if>			
				<table style="margin-left: 185px;" cellpadding="5">
					<tr height="20"></tr>
					<tr>
						<td>Name:<br><input type="text" name="name" class="form-style" value="${user.name}"/></td>
						<td>Login:<br><input type="text" name="login" class="form-style" value="${user.login}"/></td></tr>
					<tr>
						<td>E-mail:<br><input type="text" name="email" id="email" class="form-style" value="${user.email}"/></td>
						<c:if test="${user.id == null}">
							<td>Confirm E-mail:<br><input type="text" id="email2" name="email2" class="form-style" /></td>
						</c:if>	
					</tr>
					<c:if test="${user.id == null}">
						<tr>
							<td>Password:<br><input type="password" id="pass" name="pass" class="form-style" /></td>
							<td>Confirm Password: <br><input id="pass2" type="password" class="form-style" /></td>
						</tr>
					</c:if>
					<tr height="10"></tr>
					<tr>
						<td colspan="2" class="check-style">Profile Type:<br>
							<c:forEach var="key" items="${keys}">
						 		<c:if test="${user.id != null}">
									<m:edituser bool="x" param1="${profs[key]}">
										<input type="checkbox" name="profile" value='${profs[key]}' <c:if test="${x == 1}">checked="checked"</c:if> />${key}<br />
									</m:edituser>	
								</c:if>
								<c:if test="${user.id == null}">
									<input type="checkbox" name="profile" value='${profs[key]}' />${key}<br />
								</c:if>	
							</c:forEach>
						</td>
						<td></td>
					</tr>
					<tr height="20"></tr>
					<tr>
						<td></td>
						<td>
							<input type="submit" value="Send" class="button-style" />
							<c:if test="${user.id == null}">
								<input id="btnCancelar" type="button" value="Cancel" class="button-style"/>
							</c:if>
							<c:if test="${user.id != null}">
								<input id="btnVoltar" type="button" value="Back" class="button-style" onclick="history.back(1)" />
							</c:if>
						</td>
					</tr>
				</table>
			</form>
		</div>
	</div>	
</body>
</html>